independent multi-threading and sharing data problem